package ynu.edu.service;

import org.aspectj.weaver.ast.Or;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ynu.edu.common.service.LogicService;
import ynu.edu.dao.IOrderDao;
import ynu.edu.dao.IShopDao;
import ynu.edu.dto.LineItemDTO;
import ynu.edu.entity.Customer;
import ynu.edu.entity.LineItem;
import ynu.edu.entity.Order;
import ynu.edu.entity.User;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrderService extends LogicService<IOrderDao, Order,Long> {
    public OrderService(@Autowired IOrderDao lr) {
        super(lr);
    }

    @Resource
    private IShopDao shopDao;

//    public Order createOrder(User user, List<LineItemDTO> lineItems){
//        Customer customer = CustomerService.getCurrentCustomer(user);
//        if (lineItems.size()>0){
//            lineItems.get(0)
//        }
//        Order order = new Order();
//    }

    public Order getOrderByOrderId(Long orderId){
        return getDAO().getReferenceById(orderId);
    }

}
